package com.dimples.common.exception;

import com.dimples.common.enums.CodeMsgEnum;

import lombok.Getter;
import lombok.Setter;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2021/6/27
 */
@Setter
@Getter
public class AuthExpireException extends RuntimeException{

    /**
     * 异常信息
     */
    private String msg;

    /**
     * 异常状态码
     */
    private int code;

    public AuthExpireException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public AuthExpireException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public AuthExpireException(CodeMsgEnum bizExceptionEnum) {
        super(bizExceptionEnum.getMessage());
        this.code = bizExceptionEnum.getCode();
        this.msg = bizExceptionEnum.getMessage();
    }

}
